package com.haoze.nurseapp.enumeration;

import java.util.Arrays;

/**
 *
 */
public enum OrderQueryStatusTypeEnum {

	All(1, "全部"), NewOpen(3, "新开"), Arrange(2, "整理"), Stoped(4, "已停");
	private Integer value;

	private String name;

	private OrderQueryStatusTypeEnum(Integer value, String name) {
		this.value = value;
		this.name = name;
	}

	public Integer getValue() {
		return value;
	}

	public void setValue(Integer value) {
		this.value = value;
	}

	public static OrderQueryStatusTypeEnum getById(Integer id) {
		if (null == id) {
			return null;
		}
		OrderQueryStatusTypeEnum result = Arrays.asList(OrderQueryStatusTypeEnum.values()).stream()
				.filter(x -> x.getValue().intValue() == id.intValue()).findFirst().orElse(null);
		return result;

	}
}
